using System;
using System.Globalization;
using System.Text.RegularExpressions;

namespace Brotherhood.HttpUtilities
{

  public class ConnectionInfo
  {
    public string Url { get; internal set; }

    public string BaseUrl { get; set; }

    public string Username { get; set; }

    public string Password { get; set; }

    public string BaseUrlWithEndingSlash
    {
      get
      {
        return BaseUrl.EndsWith("/") ? BaseUrl : BaseUrl + "/";
      }
    }

    public string CultureInfoName { get; set; }

    public CultureInfo ConnectionCultureInfo
    {
      get
      {
        if (String.IsNullOrEmpty(CultureInfoName))
          return CultureInfo.GetCultureInfo("en-US");
        else
          return CultureInfo.GetCultureInfo(CultureInfoName);
      }
    }

    public ConnectionInfo CreateCopy()
    {
      return new ConnectionInfo{Url = this.Url, BaseUrl = this.BaseUrl,Username = this.Username,Password = this.Password,CultureInfoName = this.CultureInfoName};
    }

  }



}
